<template>
  <div id="app">
    <Header/>
    <router-view></router-view>
<!--    要求Footer组件在Home/Search页面显示，在Login/Register页面隐藏-->
<!--   写法一： <Footer v-show="$route.path === '/home' || $route.path === '/register'"/> -->
    <Footer v-show="$route.meta.footerShow"/>
  </div>
</template>

<script>


import Header from "@/components/Header/Header.vue";
import Footer from "@/components/Footer/Footer.vue";

export default {
  name: 'App',
  components: {
    Footer,
    Header

  },
  mounted() {
    // 获取三级联动列表数据（为防止多次切换TypeNav组件发送多次请求，将请求写在APP上）
    this.$store.dispatch("home/reqCategoryList")

  }
}
</script>

<style scoped>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
